/*
 * @Author: your name
 * @Date: 2021-01-13 21:14:07
 * @LastEditTime: 2021-01-25 22:56:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \scull\scull.h
 */
#ifndef __SCULL_H__
#define __SCULL_H__

#include <linux/ioctl.h>

#ifndef SCULL_MAJOR
#define SCULL_MAJOR 0 /* dynamic major by default */
#endif

#ifndef SCULL_NR_DEVS
#define SCULL_NR_DEVS 4 /* scull0 through scull3 */
#endif

#ifndef SCULL_P_NR_DEVS
#define SCULL_P_NR_DEVS 4 /* scullpipe0 through scullpipe3 */
#endif

#ifndef SCULL_QUANTUM
#define SCULL_QUANTUM 4000
#endif

#ifndef SCULL_QSET
#define SCULL_QSET 1000
#endif

struct scull_qset
{
  void **data;
  struct scull_qset *next;
};

struct scull_dev
{
  struct scull_qset *data;
  int quantum;
  int qset;
  unsigned long size;
  unsigned int access_key;
  struct mutex lock;
  struct cdev cdev;
};

#endif